<?php
namespace App\Job;

use Hyperf\AsyncQueue\Annotation\AsyncQueueMessage;

use App\Query\UserQuery;
use App\Repository\UserRepository;

// 团队业绩增加
class UserMoneyUserJob
{
    /**
     * @AsyncQueueMessage
     */
    public function push($ids, $money)
    {
        // 执行任务
        $user = UserQuery::moneyPayNo()->find($ids);
        
        $repository = UserRepository::make();
        
        foreach($user as $item)
        {
            // 放入模型
            $repository->model($item);
            
            // 加入团队业绩
            $repository->moneyUser($money);
        }
    }
}